3D Graphics Programming with QuickDraw 3D 1.5.4
Previous | QD3D Book | Overview | Chapter Contents | Next
QuickDraw 3D provides routines that you can use to create and manipulate meshes. See "Meshes" for the definition of a mesh and its associated types.
You can use the Q3Mesh_New function to create a new mesh.
TQ3GeometryObject Q3Mesh_New (void);
You can use the Q3Mesh_VertexNew function to add a vertex to a mesh.
TQ3MeshVertex Q3Mesh_VertexNew (
TQ3GeometryObject mesh,
const TQ3Vertex3D *vertex);
You can use the Q3Mesh_VertexDelete function to delete a vertex from a mesh.
TQ3Status Q3Mesh_VertexDelete (
TQ3GeometryObject mesh,
TQ3MeshVertex vertex);
You can use the Q3Mesh_FaceNew function to add a face to a mesh.
TQ3MeshFace Q3Mesh_FaceNew (
TQ3GeometryObject mesh,
unsigned long numVertices,
const TQ3MeshVertex *vertices,
TQ3AttributeSet attributeSet);
You can use the Q3Mesh_FaceDelete function to delete a face from a mesh.
TQ3Status Q3Mesh_FaceDelete (
TQ3GeometryObject mesh,
TQ3MeshFace face);
You can use the Q3Mesh_DelayUpdates function to prevent QuickDraw 3D from updating its internal list of mesh components.
TQ3Status Q3Mesh_DelayUpdates (TQ3GeometryObject mesh);
The Q3Mesh_DelayUpdates function prevents QuickDraw 3D from updating its internal list of components and maintaining correct face orientation (that is, vertex ordering) for the mesh specified by the mesh parameter. Updating the list of components can consume significant amounts of time, and it might be useful temporarily to prevent component list updating. You should later call Q3Mesh_ResumeUpdates to resume component list updating. Generally, if you are creating or deleting a number of vertices or faces from a mesh, it is better to bracket the entire set of changes with calls to Q3Mesh_DelayUpdates and Q3Mesh_ResumeUpdates .
You can use the Q3Mesh_ResumeUpdates function to have QuickDraw 3D resume updating its internal list of mesh components.
TQ3Status Q3Mesh_ResumeUpdates (TQ3GeometryObject mesh);
You can use the Q3Mesh_FaceToContour function to convert a face of a mesh into a contour. The contour is then attached to another mesh face as a hole.
TQ3MeshContour Q3Mesh_FaceToContour (
TQ3GeometryObject mesh,
TQ3MeshFace containerFace,
TQ3MeshFace face);
The Q3Mesh_FaceToContour function returns, as its function result, a new contour created from the mesh face specified by the mesh and face parameters. The new contour is contained in the mesh face specified by the mesh and containerFace parameters. If a new contour could not be created, Q3Mesh_FaceToContour returns the value NULL .
Q3Mesh_FaceToContour destroys any attributes associated with the face specified by the face parameter.
You can use the Q3Mesh_ContourToFace function to convert a mesh contour into a mesh face.
TQ3MeshFace Q3Mesh_ContourToFace (
TQ3GeometryObject mesh,
TQ3MeshContour contour);
The Q3Mesh_ContourToFace function returns, as its function result, a mesh face that is the result of removing the mesh contour specified by the mesh and contour parameters from its containing face. (You can call the Q3Mesh_GetContourFace function to determine the face that contains a mesh contour; see [link] .) If a new face could not be created, Q3Mesh_ContourToFace returns the value NULL .
You can use the Q3Mesh_GetNumComponents function to determine the number of connected components of a mesh.
TQ3Status Q3Mesh_GetNumComponents (
TQ3GeometryObject mesh,
unsigned long *numComponents);
The Q3Mesh_GetNumComponents function returns, in the numComponents parameter, the number of connected components in the mesh specified by the mesh parameter. A connected component is a list of vertices, each of which is connected to all the others by some sequence of mesh edges. For example, a mesh that contains two cubes has two components.
You can use the Q3Mesh_GetNumEdges function to determine the number of edges of a mesh.
TQ3Status Q3Mesh_GetNumEdges (
TQ3GeometryObject mesh,
unsigned long *numEdges);
You can use the Q3Mesh_GetNumVertices function to determine the number of vertices of a mesh.
TQ3Status Q3Mesh_GetNumVertices (
TQ3GeometryObject mesh,
unsigned long *numVertices);
You can use the Q3Mesh_GetNumFaces function to determine the number of faces of a mesh.
TQ3Status Q3Mesh_GetNumFaces (
TQ3GeometryObject mesh,
unsigned long *numFaces);
You can use the Q3Mesh_GetNumCorners function to determine the number of corners of a mesh that have attribute sets.
TQ3Status Q3Mesh_GetNumCorners (
TQ3GeometryObject mesh,
unsigned long *numCorners);
You can use the Q3Mesh_GetOrientable function to determine whether the faces of a mesh can be consistently oriented.
TQ3Status Q3Mesh_GetOrientable (
TQ3GeometryObject mesh,
TQ3Boolean *orientable);
The Q3Mesh_GetOrientable function returns, in the orientable parameter, the value kQ3True if the faces of the mesh specified by the mesh parameter can be consistently oriented; Q3Mesh_GetOrientable returns kQ3False otherwise. For example, the faces of a tessellated Möbius strip or a Klein bottle cannot be consistently oriented.
You can use the Q3Mesh_GetComponentNumVertices function to determine the number of vertices in a component of a mesh.
TQ3Status Q3Mesh_GetComponentNumVertices (
TQ3GeometryObject mesh,
TQ3MeshComponent component,
unsigned long *numVertices);
You can use the Q3Mesh_GetComponentNumEdges function to determine the number of edges in a component of a mesh.
TQ3Status Q3Mesh_GetComponentNumEdges (
TQ3GeometryObject mesh,
TQ3MeshComponent component,
unsigned long *numEdges);
You can use the Q3Mesh_GetComponentBoundingBox function to determine the bounding box of a component of a mesh.
TQ3Status Q3Mesh_GetComponentBoundingBox (
TQ3GeometryObject mesh,
TQ3MeshComponent component,
TQ3BoundingBox *boundingBox);
You can use the Q3Mesh_GetComponentOrientable function to determine whether the faces of a component of a mesh can be consistently oriented.
TQ3Status Q3Mesh_GetComponentOrientable (
TQ3GeometryObject mesh,
TQ3MeshComponent component,
TQ3Boolean *orientable);
You can use the Q3Mesh_GetVertexCoordinates function to get the coordinates of a vertex of a mesh.
TQ3Status Q3Mesh_GetVertexCoordinates (
TQ3GeometryObject mesh,
TQ3MeshVertex vertex,
TQ3Point3D *coordinates);
You can use the Q3Mesh_SetVertexCoordinates function to set the coordinates of a vertex of a mesh.
TQ3Status Q3Mesh_SetVertexCoordinates (
TQ3GeometryObject mesh,
TQ3MeshVertex vertex,
const TQ3Point3D *coordinates);
You can use the Q3Mesh_GetVertexIndex function to get the index of a mesh vertex.
TQ3Status Q3Mesh_GetVertexIndex (
TQ3GeometryObject mesh,
TQ3MeshVertex vertex,
unsigned long *index);
The Q3Mesh_GetVertexIndex function returns, in the index parameter, the index of the mesh vertex specified by the mesh and vertex parameters. A vertex index is a unique integer (between 0 and the total number of vertices in the mesh minus 1) associated with a vertex.
Vertex indices are volatile and can be changed by functions that alter the topology of a mesh (such as functions that add or delete faces or vertices), and by writing, picking, rendering, or duplicating a mesh, or by calling Q3Mesh_DelayUpdates . As a result, you should rely on an index returned by Q3Mesh_GetVertexIndex only until you perform one of these operations.
You can use the Q3Mesh_GetVertexOnBoundary function to determine whether a vertex lies on the boundary of a mesh.
TQ3Status Q3Mesh_GetVertexOnBoundary (
TQ3GeometryObject mesh,
TQ3MeshVertex vertex,
TQ3Boolean *onBoundary);
You can use the Q3Mesh_GetVertexComponent function to get the component of a mesh to which a vertex belongs.
TQ3Status Q3Mesh_GetVertexComponent (
TQ3GeometryObject mesh,
TQ3MeshVertex vertex,
TQ3MeshComponent *component);
You can use the Q3Mesh_GetVertexAttributeSet function to get the attribute set of a vertex of a mesh.
TQ3Status Q3Mesh_GetVertexAttributeSet (
TQ3GeometryObject mesh,
TQ3MeshVertex vertex,
TQ3AttributeSet *attributeSet);
You can use the Q3Mesh_SetVertexAttributeSet function to set the attribute set of a vertex of a mesh.
TQ3Status Q3Mesh_SetVertexAttributeSet (
TQ3GeometryObject mesh,
TQ3MeshVertex vertex,
TQ3AttributeSet attributeSet);
You can use the Q3Mesh_GetFaceNumVertices function to determine the number of vertices in a face of a mesh.
TQ3Status Q3Mesh_GetFaceNumVertices (
TQ3GeometryObject mesh,
TQ3MeshFace face,
unsigned long *numVertices);
You can use the Q3Mesh_GetFacePlaneEquation function to determine the plane equation of a face of a mesh.
TQ3Status Q3Mesh_GetFacePlaneEquation (
TQ3GeometryObject mesh,
TQ3MeshFace face,
TQ3PlaneEquation *planeEquation);
The Q3Mesh_GetFacePlaneEquation function returns, in the planeEquation parameter, the plane equation of the plane spanned by the vertices of the mesh face specified by the mesh and face parameters. If the vertices of the mesh face do not all lie in one plane, the information returned in the planeEquation parameter is only an approximation.
You can use the Q3Mesh_GetFaceNumContours function to determine the number of contours in a face of a mesh.
TQ3Status Q3Mesh_GetFaceNumContours (
TQ3GeometryObject mesh,
TQ3MeshFace face,
unsigned long *numContours);
The Q3Mesh_GetFaceNumContours function returns, in the numContours parameter, the number of contours in the mesh face specified by the mesh and face parameters. A mesh face always contains at least one contour, which defines the face itself. Any additional contours in the face define holes in the face.
You can use the Q3Mesh_GetFaceIndex function to get the index of a mesh face.
TQ3Status Q3Mesh_GetFaceIndex (
TQ3GeometryObject mesh,
TQ3MeshFace face,
unsigned long *index);
The Q3Mesh_GetFaceIndex function returns, in the index parameter, the index of the mesh face specified by the mesh and face parameters. A face index is a unique integer (between 0 and the total number of faces in the mesh minus 1) associated with a face.
Face indices are volatile and can be changed by functions that alter the topology of a mesh (such as functions that add or delete faces or vertices), and by writing, picking, rendering, or duplicating a mesh, or by calling Q3Mesh_DelayUpdates . As a result, you should rely on an index returned by Q3Mesh_GetFaceIndex only until you perform one of these operations.
You can use the Q3Mesh_GetFaceComponent function to get the component of a mesh to which a face belongs.
TQ3Status Q3Mesh_GetFaceComponent (
TQ3GeometryObject mesh,
TQ3MeshFace face,
TQ3MeshComponent *component);
You can use the Q3Mesh_GetFaceAttributeSet function to get the attribute set of a face of a mesh.
TQ3Status Q3Mesh_GetFaceAttributeSet (
TQ3GeometryObject mesh,
TQ3MeshFace face,
TQ3AttributeSet *attributeSet);
You can use the Q3Mesh_SetFaceAttributeSet function to set the attribute set of a face of a mesh.
TQ3Status Q3Mesh_SetFaceAttributeSet (
TQ3GeometryObject mesh,
TQ3MeshFace face,
TQ3AttributeSet attributeSet);
You can use the Q3Mesh_GetEdgeVertices function to get the vertices of a mesh edge.
TQ3Status Q3Mesh_GetEdgeVertices (
TQ3GeometryObject mesh,
TQ3MeshEdge edge,
TQ3MeshVertex *vertex1,
TQ3MeshVertex *vertex2);
You can use the Q3Mesh_GetEdgeFaces function to get the faces that share a mesh edge.
TQ3Status Q3Mesh_GetEdgeFaces (
TQ3GeometryObject mesh,
TQ3MeshEdge edge,
TQ3MeshFace *face1,
TQ3MeshFace *face2);
You can use the Q3Mesh_GetEdgeOnBoundary function to determine whether a mesh edge lies on the boundary of the mesh.
TQ3Status Q3Mesh_GetEdgeOnBoundary (
TQ3GeometryObject mesh,
TQ3MeshEdge edge,
TQ3Boolean *onBoundary);
You can use the Q3Mesh_GetEdgeComponent function to get the component of a mesh to which an edge belongs.
TQ3Status Q3Mesh_GetEdgeComponent (
TQ3GeometryObject mesh,
TQ3MeshEdge edge,
TQ3MeshComponent *component);
You can use the Q3Mesh_GetEdgeAttributeSet function to get the attribute set of an edge of a mesh.
TQ3Status Q3Mesh_GetEdgeAttributeSet (
TQ3GeometryObject mesh,
TQ3MeshEdge edge,
TQ3AttributeSet *attributeSet);
You can use the Q3Mesh_SetEdgeAttributeSet function to set the attribute set of an edge of a mesh.
TQ3Status Q3Mesh_SetEdgeAttributeSet (
TQ3GeometryObject mesh,
TQ3MeshEdge edge,
TQ3AttributeSet attributeSet);
You can use the Q3Mesh_GetContourFace function to get the mesh face that contains a mesh contour.
TQ3Status Q3Mesh_GetContourFace (
TQ3GeometryObject mesh,
TQ3MeshContour contour,
TQ3MeshFace *face);
You can use the Q3Mesh_GetContourNumVertices function to get the number of vertices that define a contour.
TQ3Status Q3Mesh_GetContourNumVertices (
TQ3GeometryObject mesh,
TQ3MeshContour contour,
unsigned long *numVertices);
You can use the Q3Mesh_GetCornerAttributeSet function to get the attribute set of a mesh corner.
TQ3Status Q3Mesh_GetCornerAttributeSet (
TQ3GeometryObject mesh,
TQ3MeshVertex vertex,
TQ3MeshFace face,
TQ3AttributeSet *attributeSet);
The Q3Mesh_GetCornerAttributeSet function returns, in the attributeSet parameter, the set of attributes of the corner defined by the vertex and face parameters in the mesh specified by the mesh parameter. The corner attributes override any attributes associated with the vertex alone. The reference count of the set is incremented.
You can use the Q3Mesh_SetCornerAttributeSet function to set the attribute set of a mesh corner.
TQ3Status Q3Mesh_SetCornerAttributeSet (
TQ3GeometryObject mesh,
TQ3MeshVertex vertex,
TQ3MeshFace face,
TQ3AttributeSet attributeSet);
The Q3Mesh_SetCornerAttributeSet function sets the attribute set of the corner defined by the vertex and face parameters in the mesh specified by the mesh parameter to the set of attributes specified by the attributeSet parameter. The corner attributes override any attributes associated with the vertex alone.
Previous | QD3D Book | Overview | Chapter Contents | Next